<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('宠物列表')"/>
    <th:block th:include="include :: layout-latest-css"/>
    <th:block th:include="include :: ztree-css"/>
</head>
<body class="gray-bg">
<div class="ui-layout-center">
    <div class="container-div">

        <form id="user-form">
            <div class="col-md-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">申请理由：</label>
                    <div class="col-sm-7">
                        <textarea id="remark" type="text" name="" class="form-control" placeholder="请输入申请理由"></textarea>
                    </div>
                </div>
            </div>
        </form>

    </div>
</div>
</div>

<th:block th:include="include :: footer"/>
<th:block th:include="include :: layout-latest-js"/>
<th:block th:include="include :: ztree-js"/>
<script th:inline="javascript">

    function submitHandler() {
        applyAdopt();
    }
    function applyAdopt() {
        var remark = $('#remark').val();
        var formData = new FormData();
        var id =[[${petid}]];
        formData.append("remark",remark);
        $.ajax({
            processData: false,
            contentType: false,
            cache: false,
            type: "POST",
            data:formData,
            url: ctx+"user/pet/applyAdopt/" + id,
            async: false,
            error: function (request) {
                $.modal.alertError("系统错误");
            },
            success: function (data) {
                $.operate.successCallback(data);
            }
        });
    }

</script>
</body>
</html>